# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kpmcore
pkgver=23.08.4
pkgrel=0
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://kde.org/applications/system/org.kde.partitionmanager"
pkgdesc="Library for managing partitions"
license="GPL-3.0-or-later"
depends="
	device-mapper-udev
	sfdisk
	smartmontools
	"
makedepends="
	extra-cmake-modules
	kauth5-dev
	kcoreaddons5-dev
	ki18n5-dev
	kwidgetsaddons5-dev
	qca-dev
	qt5-qtbase-dev
	samurai
	"
_repo_url="https://invent.kde.org/system/kpmcore.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kpmcore-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # Requires running dbus server

# secfixes:
#   4.2.0-r0:
#     - CVE-2020-27187

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
79b6c1e8e35930c5c852156ab578e44cc7742bc0dfacbc5f85c7a61c980d3e0d0242060bff3ba933c07ec5d91b788d94bdd5f38cceb11c1b6f6845f8bdecafe4  kpmcore-23.08.4.tar.xz
"
